From: Jasper St. Pierre Date: Thu, 12 Jul 2012 00:26:11 +0000 (-0400) Subject: st-icon: Fix potential crash involving shadows X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6348 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=bdb3410d9d86a443718f153ed86f92622fd82bff;p=gnome-shell.git st-icon: Fix potential crash involving shadows If the icon is painted before the new shadow is around, a stale shadow material will be painted with a NULL shadow spec, resulting in a crash. https://bugzilla.gnome.org/show_bug.cgi?id=679776 --- diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 9c2ac5e91..ff75d32ec 100644 --- a/src/st/st-icon.c +++ b/src/st/st-icon.c @@ -302,6 +302,13 @@ st_icon_style_changed (StWidget *widget) st_shadow_unref (priv->shadow_spec); priv->shadow_spec = NULL; } + + if (priv->shadow_material) + { + cogl_handle_unref (priv->shadow_material); + priv->shadow_material = COGL_INVALID_HANDLE; + } + priv->shadow_spec = st_theme_node_get_shadow (theme_node, "icon-shadow"); if (priv->shadow_spec && priv->shadow_spec->inset)